"""
使用pw_meta_class的例子
"""

from pw_meta_class import PwSpider

class Spider(PwSpider):

    def __init__(self, pPort=10809, headless=False, Brow="webkit", anony=True):
        super().__init__(pPort, headless, Brow, anony)

    def get_list_html(self,url):
        device = self.get_device()
        page = self.browser.new_page(
            **device
        )
        while True:
            try:
                page.goto(
                    url,
                    wait_until = 'domcontentloaded'
                )
                break
            except:
                pass
        
        html = page.content()

        page.close()

        return html


if __name__ == "__main__":
    pass